class ImageUrlUtil {

  static String getClean(String url, {int w = 750, int quality = 80}) {
    if (url != null) {
      if (url.startsWith('https://loxen-app') && url.endsWith('?x-oss-process=image/format,webp')) {
        return url.split('?')[0] + "?x-oss-process=image/resize,w_$w/quality,Q_$quality";
      } else {
        if (url.startsWith('https://loxen-app')) {
          return url + "?x-oss-process=image/resize,w_$w/quality,Q_$quality";
        } else {
          return url;
        }
      }
    } else {
      return '';
    }
  }
}
